import serverApiMockUtils from '../utils/serverApiMockUtils'
import OssSupplierResponse from '@/core/oss/types/model/response/OssSupplierResponse'
import OssSupplierTypeEnum from '@/core/oss/enums/OssSupplierTypeEnum'
import { MockMethod } from 'vite-plugin-mock'
import mockProdServerUtils from '../utils/mockUtils'
import ossAdminApiConfig from '@/core/oss/generated/apiconfig/ossAdminApiConfig'

const content: OssSupplierResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		type: OssSupplierTypeEnum.OSS_ALIYUN.getCode(),
		title: `title_Oss供应商配置_${i.toString()}`,
		config: JSON.stringify({
			defaultAcl: 'default',
			multipartThreshold: 134217728,
			multipartPartSize: 33554432,
			accessKey: 'AccessKey',
			secretKey: 'SecretKey',
			bucketName: 'BucketName',
			domain: 'Domain',
			basePath: 'BasePath',
			attr: {
				name: 'name',
				value: 'value',
			},
		}),
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as OssSupplierResponse)
}
const mockList = [...serverApiMockUtils.getDefaultServerApi(ossAdminApiConfig.ossSupplier, content)] as MockMethod[]

mockProdServerUtils.addPriorityMockList(1, ...mockList)
